﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script src="/Scripts/szjt-allScripts.js" type="text/javascript"></script>
</head>
<body>
    <div id="searchCondition" formtype="query">
        <table id="Vehicle" class="szjt-edittable" width="100%">            
            <tr>
                <td>车牌号</td>
                <td><input id="Vehicle_VehicleLicense" type="text" class="easyui-validatebox" /></td>
           
                <td>车辆型号</td>
                <td><input id="Vehicle_VehicleUnit" type="text" class="easyui-validatebox" /></td>
            </tr>
            <tr>
                <td>车辆状态</td>
                <td>
                    <select id="Vehicle_VehicleStatus" type="text" class="szjt-codecombo" required="true"
                        category="车辆状态" />
                </td>
                <td></td>
                <td></td>
            </tr>
        </table>
        <input id="Vehicle_PageIndex" type="hidden" class="easyui-validatebox" value="0" />
        <input id="Vehicle_PageSize" type="hidden" class="easyui-validatebox" value="10" />
    </div>
    <table id="vehicleList">
    </table>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#searchCondition").formpanel({
                formtype: "query",
                formTemplate: PrjConstant.Business.Vehicle.VehicleQuery.Template,
                taskGuid: PrjConstant.SysInfo.TaskGuid,
                onExecuteComplete: function (queryResult) {
                    $("#vehicleList").detailgrid("loadXmlString", { xml: queryResult, totalNode: "RecordCount", dataNode: "VehicleInfo" });
                }
            });

            $("#vehicleList").detailgrid({
                bizName: '车辆信息',
                guidColumn: 'VehicleGuid',
                nameColumn: 'VehicleLicense',
                allowCopy: false,
                allowAdd: true,
                allowDelete: false,
                allowEdit: true,
                fit: true,
                pageSize: $("#Vehicle_PageSize").val(),
                columns: [[
                    { field: 'VehicleGuid', title: 'GUID', hidden: true },
                    { field: 'VehicleLicense', title: '车牌号', width: 100 },
                    { field: 'VehicleUnit', title: '车辆型号', width: 100 },
                    { field: 'VehicleStatus', title: '车辆状态', width: 100 }
                ]],
                onAction: function (actionCode, actionName, bizName, selectedList) {
                    if (actionCode == "delete") {
                        var result = dataService.delDataList(PrjConstant.PrjTaskGuid.DriverTraining, selectedList, PrjConstant.Business.Student.StudentInfo.DataType);
                        utility.message.promptOperationResult(actionName, bizName, (result == 0));
                    }
                    else {                       
                        utility.page.popupDialog({ editParameter: { actionCode: actionCode, selectedList: selectedList },
                            title: actionName + bizName, width: 600, height: 310,
                            parentTitle: utility.page.getCurrentTabTitle(),
                            href: '/Pages/Business/Vehicle/VehicleInfo.htm'
                        });
                    }
                },
                onSelectPage: function (pageNumber, pageSize) {
                    $("#Vehicle_PageIndex").val(pageNumber - 1);
                    RefreshData();
                }
            });

        });

        function RefreshData() {
            $("#searchCondition").triggerHandler("_execute");
        }
    </script>
</body>
</html>
